<?php if (!defined('THINK_PATH')) exit(); /*a:2:{s:79:"D:\laragon\www\zgh\public/../application/admin\view\video\video_management.html";i:1533030764;s:44:"../application/admin/view/common/header.html";i:1533030634;}*/ ?>
﻿<!DOCTYPE html>
<html lang="en">
<head>
    <meta charset="utf-8">
    <meta http-equiv="X-UA-Compatible" content="IE=Edge,chrome=1">
    <meta name="viewport" content="width=device-width, initial-scale=1">
    <!-- The above 3 meta tags *must* come first in the head; any other head content must come *after* these tags -->
    <title>知果汇</title>
    <!-- Common plugins -->
    <link href="_CSS_/bootstrap.min.css" rel="stylesheet">
    <link href="_CSS_/simple-line-icons.css" rel="stylesheet">
    <link href="_CSS_/font-awesome.min.css" rel="stylesheet">
    <link href="_CSS_/jasny-bootstrap.min.css" rel="stylesheet">
    <link rel="stylesheet" href="_CSS_/nanoscroller.css">
    <link href="_CSS_/style.css" rel="stylesheet">
    <link rel="stylesheet" type="text/css" href="_CSS_/jquery-ui.css">
    <!-- HTML5 shim and Respond.js for IE8 support of HTML5 elements and media queries -->
    <!--[if lt IE 9]>
    <script src="_JS_/html5shiv.min.js"></script>
    <script src="_JS_/respond.min.js"></script>
    <![endif]-->
</head>
<body>

<div class="top-bar light-top-bar">
    <div class="container-fluid">
        <div class="row">
            <div class="col-xs-7 col-md-7">
                <a href="/index.php" target="_blank" class="admin-logo">
                    <h1><img src="_IMG_/logo.png" alt=""></h1>
                </a>
                <p class="top-left-p"><span></span><b id="page-title"></b></p>
                <div class="left-nav-toggle visible-xs visible-sm">
                    <a href="">
                        <i class="glyphicon glyphicon-menu-hamburger"></i>
                    </a>
                </div>
            </div>
            <div class="col-xs-5 col-md-5" style="padding-right:35px ">
                <ul class="list-inline top-right-nav">
                    <li class="admin-action">
                        <a href="javascript: void(0);"><span id="username" style="font-weight: bold;"></span><span
                                style="margin-left: 10px;" class="ui-icon  ui-icon-caret-1-n"></span></a>
                        <div class="hide-nav">
                            <a class="person-em" href="javascript: void(0);"><i></i>个人信息</a>
                            <a class="person-ch" href="<?php echo url('admin/login/index'); ?>"><i></i>切换用户</a>
                        </div>
                    </li>
                    <li>
                        <a id="bow_out" href="javascript: void(0);"><i></i>退出</a>
                    </li>
                </ul>
            </div>
        </div>
    </div>
</div>
<!-- top bar end-->

<!--left navigation start-->
<aside class="float-navigation light-navigation">
    <div class="nano">
        <div class="nano-content">
            <ul class="metisMenu nav" id="menu">

                <!--<li id="admin_management">-->
                <!--<a href="javascript: void(0);" aria-expanded="true"><i class="icon-home"></i> 管理员管理<span-->
                <!--class="fa arrow"></span></a>-->
                <!--<ul class="nav-second-level nav" aria-expanded="true">-->
                <!--<li id="admin_list"><a href="<?php echo url('Admin/index'); ?>">管理员列表</a></li>-->
                <!--<li id="admin_role"><a href="<?php echo url('Role/role_list'); ?>">权限列表</a></li>-->
                <!--</ul>-->
                <!--</li>-->
                <!--<li id="log_management">-->
                <!--<a href="javascript: void(0);" aria-expanded="true"><i class="icon-handbag"></i> 系统日志管理 <span-->
                <!--class="fa arrow"></span></a>-->
                <!--<ul class="nav-second-level nav" aria-expanded="true">-->
                <!--<li id="log_admin"><a href="<?php echo url('Log/admin_list'); ?>">管理员日志管理</a></li>-->
                <!--<li id="log_visitor"><a href="<?php echo url('Log/visitor_list'); ?>">游客日志管理</a></li>-->
                <!--<li id="log_ment"><a href="<?php echo url('Log/ment_list'); ?>">会员日志管理</a></li>-->
                <!--</ul>-->
                <!--</li>-->
                <!--<li id="new_management">-->
                <!--<a href="javascript: void(0);" aria-expanded="true"><i class="icon-envelope-letter"></i> 新闻管理 <span-->
                <!--class="fa arrow"></span></a>-->
                <!--<ul class="nav-second-level nav" aria-expanded="true">-->
                <!--<li id="government_management"><a href="<?php echo url('News/government_work'); ?>">政务工作管理</a></li>-->
                <!--&lt;!&ndash;<li id="platform_management"><a href="<?php echo url('News/platform_information'); ?>">平台资讯管理</a></li>&ndash;&gt;-->
                <!--</ul>-->
                <!--</li>-->
                <!--<li id="train_management">-->
                <!--<a href="javascript: void(0);" aria-expanded="true"><i class="icon-envelope-letter"></i> 人才培训管理-->
                <!--<span class="fa arrow"></span></a>-->
                <!--<ul class="nav-second-level nav" aria-expanded="true">-->
                <!--<li id="video_management"><a href="<?php echo url('Video/video_management'); ?>">视频管理</a></li>-->
                <!--<li id="talent_management"><a href="<?php echo url('Talent/talent_management'); ?>">人才库管理</a></li>-->
                <!--<li id="teacher_management"><a href="<?php echo url('Talent/teacher_management'); ?>">师资库管理</a></li>-->
                <!--</ul>-->
                <!--</li>-->
                <!--<li id="system_management">-->
                <!--<a href="javascript: void(0);" aria-expanded="true"><i class="icon-envelope-letter"></i> 系统配置管理-->
                <!--<span class="fa arrow"></span></a>-->
                <!--<ul class="nav-second-level nav" aria-expanded="true">-->
                <!--<li id="keys_management"><a href="<?php echo url('Keys/index'); ?>">密钥管理</a></li>-->
                <!--<li id="param_management"><a href="<?php echo url('Param/index'); ?>">参数管理</a></li>-->
                <!--<li id="database_backup"><a href="<?php echo url('Param/backup'); ?>">数据库备份</a></li>-->
                <!--<li id="dictionary"><a href="<?php echo url('Dictionary/index'); ?>">数据字典</a></li>-->
                <!--<li id="material"><a href="<?php echo url('Material/index'); ?>">素材库管理</a></li>-->
                <!--</ul>-->
                <!--</li>-->
                <!--<li id="review_management">-->
                <!--<a href="javascript: void(0);" aria-expanded="true"><i class="icon-envelope-letter"></i>商品审核管理 <span-->
                <!--class="fa arrow"></span></a>-->
                <!--<ul class="nav-second-level nav" aria-expanded="true">-->
                <!--<li id="review_trading"><a href="<?php echo url('Market/trading_market_management'); ?>">交易市场管理</a></li>-->
                <!--<li id="review_service"><a href="<?php echo url('Market/service_market_management'); ?>">服务市场管理</a></li>-->
                <!--</ul>-->
                <!--</li>-->
                <!--<li id="banner_management">-->
                <!--<a href="javascript: void(0);" aria-expanded="true"><i class="icon-envelope-letter"></i>banner管理-->
                <!--<span class="fa arrow"></span></a>-->
                <!--<ul class="nav-second-level nav" aria-expanded="true">-->
                <!--<li id="banner_index"><a href="<?php echo url('Banner/banner_index'); ?>">首页banner管理</a></li>-->
                <!--<li id="banner_government"><a href="<?php echo url('Banner/banner_government'); ?>">政务工作banner管理</a></li>-->
                <!--<li id="banner_talent"><a href="<?php echo url('Banner/banner_talent'); ?>">人才培训banner管理</a></li>-->
                <!--</ul>-->
                <!--</li>-->
                <!--<li id="member_management">-->
                <!--<a href="javascript: void(0);" aria-expanded="true"><i class="icon-envelope-letter"></i> 会员管理-->
                <!--<span class="fa arrow"></span></a>-->
                <!--<ul class="nav-second-level nav" aria-expanded="true">-->
                <!--<li id="member_list"><a href="<?php echo url('Member/index'); ?>">会员资料管理管理</a></li>-->
                <!--</ul>-->
                <!--</li>-->
                <!--<li id="complain_management">-->
                <!--<a href="javascript: void(0);" aria-expanded="true"><i class="icon-envelope-letter"></i> 信息管理 <span-->
                <!--class="fa arrow"></span></a>-->
                <!--<ul class="nav-second-level nav" aria-expanded="true">-->
                <!--<li id="complain_index"><a href="<?php echo url('Complain/complain_index'); ?>">　交易申诉管理</a></li>-->
                <!--<li id="complain_feedback"><a href="<?php echo url('Complain/complain_feedback'); ?>">　意见反馈管理</a></li>-->
                <!--</ul>-->
                <!--</li>-->
                <!--<li id="authentication_management">-->
                <!--<a href="javascript: void(0);" aria-expanded="true"><i class="icon-envelope-letter"></i> 认证管理 <span-->
                <!--class="fa arrow"></span></a>-->
                <!--<ul class="nav-second-level nav" aria-expanded="true">-->
                <!--<li id="authentication_personal"><a href="<?php echo url('Authentication/authentication_personal'); ?>">　个人认证管理</a>-->
                <!--</li>-->
                <!--<li id="authentication_enterprise"><a href="<?php echo url('Authentication/authentication_enterprise'); ?>">　企业认证管理</a>-->
                <!--</li>-->
                <!--</ul>-->
                <!--</li>-->
                <!--<li id="shop_management">-->
                <!--<a href="javascript: void(0);" aria-expanded="true"><i class="icon-envelope-letter"></i> 店铺管理 <span-->
                <!--class="fa arrow"></span></a>-->
                <!--<ul class="nav-second-level nav" aria-expanded="true">-->
                <!--<li id="shop_audits"><a href="<?php echo url('Shop/shop_audits'); ?>">　店铺审核管理</a></li>-->
                <!--<li id="shop_information"><a href="<?php echo url('Shop/shop_information'); ?>">　店铺信息管理</a></li>-->
                <!--</ul>-->
                <!--</li>-->
                <!--<li id="orders_management">-->
                <!--<a href="javascript: void(0);" aria-expanded="true"><i class="icon-envelope-letter"></i> 订单管理 <span-->
                <!--class="fa arrow"></span></a>-->
                <!--<ul class="nav-second-level nav" aria-expanded="true">-->
                <!--<li id="orders_trading"><a href="<?php echo url('Orders/orders'); ?>?trading">　交易宝贝订单管理</a></li>-->
                <!--<li id="orders_service"><a href="<?php echo url('Orders/orders'); ?>?service">　服务宝贝订单管理</a></li>-->
                <!--<li id="orders_evaluation"><a href="<?php echo url('Orders/evaluation_orders'); ?>">　订单评价管理</a></li>-->
                <!--<li id="orders_address"><a href="<?php echo url('Orders/address_orders'); ?>">　地址管理</a></li>-->
                <!--</ul>-->
                <!--</li>-->
                <!--<li id="details_management">-->
                <!--<a href="javascript: void(0);" aria-expanded="true"><i class="icon-envelope-letter"></i> 明细管理 <span-->
                <!--class="fa arrow"></span></a>-->
                <!--<ul class="nav-second-level nav" aria-expanded="true">-->
                <!--<li id="details_orders"><a href="<?php echo url('Orders/details_orders'); ?>">　订单明细管理</a></li>-->
                <!--</ul>-->
                <!--</li>-->


            </ul>
        </div><!--nano content-->
    </div><!--nano scroll end-->
</aside>
<!--left navigation end-->
<script src="_JS_/jquery.min.js"></script>
<script type="text/javascript">
    $(function () {
        //获取登录信息
        var userinfo = $.cookie('username');
        if (userinfo != null) {
            var user_login = $.base64.decode(userinfo).split(",");
            $("#username").html(user_login[0]).attr("user_id", user_login[1]);
        } else {
            window.location.href = "<?php echo url('Login/index'); ?>";
        }
        $(".person-em").on('click', function () {
            window.location.href = "<?php echo url('admin/person/index'); ?>"
        })

        //退出登录
        $('#bow_out').on('click', function () {
            $.cookie('username', "", {expires: -1, path: '/'});
            window.location.href = "<?php echo url('Login/index'); ?>";
        });
        $.ajax({
            type: 'GET',
            url: "<?php echo url('api/common/menu'); ?>",
            dataType: 'jsonp',
            jsonp: 'callback',
            success: function (msg) {
                if (msg.code == 200) {
                    $("#menu").html("");
                    if (msg.data.length > 0) {
                        var html = '';
                        for (var i = 0; i < msg.data.length; i++) {
                            if (msg.data[i].pid == 0) {
                                html += '<li id="' + msg.data[i].ace + '">' +
                                    '<a href="javascript:;" aria-expanded="true">' +
                                    '<i class="' + msg.data[i].icon + '"></i>' + msg.data[i].name + ' ' +
                                    '<span class="fa arrow"></span>' +
                                    '</a><ul class="nav-second-level nav collapse" aria-expanded="true">';
                                for (var j = 0; j < msg.data.length; j++) {
                                    if (msg.data[j].pid == msg.data[i].id && msg.data[j].pid != 0) {
                                        html += '<li id="' + msg.data[j].ace + '">' +
                                            '<a href="/index.php/' + msg.data[j].label + '">' +
                                            '' + msg.data[j].name + '</a></li>';
                                    }
                                }
                                html += '</ul></li>';
                            }
                        }
                        $("#menu").html(html);//table添加数据
                        $('.metisMenu li').click(function () {
                            $(this).addClass("active");
                            if ($(this).children("ul").hasClass("in")) {
                                $(this).children("ul").removeClass("in");
                            } else {
                                $("#menu li ul").removeClass("in");
                                $(this).children("ul").addClass("in");
                            }
                        })
                    }
                } else {
                    layer.msg('查询失败', {icon: 5, time: 1000});
                }
            }
        })
    });

</script>
        <!--[if lt IE 9]>
          <script src="_JS_/html5shiv.min.js"></script>
          <script src="_JS_/respond.min.js"></script>
        <![endif]-->
        <style type="text/css">
            .btn-blue,.btn-blue:hover,.btn-blue:focus{background-color: #3171b4;border-color: #3171b4;color:#ffffff;}
            .table-btn,.table-btn:hover,.table-btn:focus{border-radius: 2px;-webkit-border-radius: 2px;text-transform: capitalize;font-size: 13px;padding: 0px 4px;font-weight: 400;color: #666666;background-color: #c3c3c3;}
            .enable{color: #3171b4}
            .disable{color: #ff2929}
            .table{text-align: center;}
            .table thead{background-color: #aad4ff;}
            .table tbody{font-size: 13px;color: #333333;}
            .table tbody .buttons{padding: 3px;}
            .table thead{font-size: 14px;font-weight: bold;color: #111111;}
            .table thead th{text-align: center;}
        </style>

        <!--main content start-->
        <section class="main-content">


            <!--start page content-->

            <div class="row">
               
                 <div class="col-md-12">
                    <div class="panel panel-default collapsed">
                        <div class="panel-heading"> 
                            <a class="btn btn-danger ui-w" onclick="datadel()" href="javascript:void(0);"><span class="ui-icon ui-icon-trash"> </span>批量删除</a>
                            <a class="btn btn-blue ui-w" onclick="video_list_add(this)" href="javascript:void(0);"><span class="ui-icon ui-icon-plus"></span>添加视频集</a>
                            <label for="name" style="color: #666666;font-size: 16px;font-weight: normal;line-height: 34px;margin: 3px 0;margin-left: 25px;">视频类别
                                <select style="height: 34px;border:1px solid #e0e0e0;width: 150px; " name="type" id="sort">
                                    <option value="0">全部</option>
                                    <option value="1">专利评议</option>
                                    <option value="2">专利维权</option>
                                    <option value="3">专利托管</option>
                                    <option value="4">专利代理</option>
                                    <option value="5">政策应用</option>
                                    <option value="6">设计开发</option>
                                    <option value="7">其他</option>
                                </select>
                            </label>
                            <div class="search-form">
                                <input type="text" class="form-control" placeholder="输入视频标题" />
                                <button type="button" class="btn-search" onclick="search_btn()"><i class="fa fa-search"></i></button>
                            </div>
                        </div>
                        <div class="panel-body">

                            <table class="table table-hover table-striped table-bordered" data-page-size="12" data-filter=#filter>
                                <thead>
                                <tr>
                                    <th>选择</th>
                                    <th>ID</th>
                                    <th>发布人</th>
                                    <th>视频标题</th>
                                    <th>视频类别</th>
                                    <th>浏览次数</th>
                                    <th>集数</th>
                                    <th>点赞次数</th>
                                    <th>收藏次数</th>
                                    <th>发布时间</th>
                                    <th>查看详情</th>
                                    <th>状态</th>
                                    <th>操作</th>
                                </tr>
                                </thead>
                                <tbody>


                                    
                                
                                </tbody>
                            </table>
                            <button class="btn" style="float: left;margin: 20px 0" onclick="down_excel()" title="下载">导出excel</button>
                            <div class="pager" id="page" style="text-align: right;float: right;"></div>
                         </div>
                    </div>
                </div>
            </div><!--end row-->
            
            <!--end page content-->



            <!-- <footer class="footer">
                <span></span>
            </footer> -->
       

        </section>
        <!--end main content-->



        <!--Common plugins-->
        <script src="_JS_/jquery.min.js"></script>
        <script src="_JS_/jquery.base64.js"></script>
        <script src="_JS_/jquery.cookie.js"></script>
        <script src="_JS_/bootstrap.min.js"></script>
        <script src="_JS_/jasny-bootstrap.min.js"></script>
        <script src="_JS_/jquery.slimscroll.min.js"></script>
        <script src="_JS_/jquery.nanoscroller.min.js"></script>
        <script src="_JS_/metismenu.min.js"></script>
        <script src="_JS_/float-custom.js"></script>
        <script type="text/javascript" src="_JS_/layer/layer.js"></script>
        <script type="text/javascript" src="_JS_/laypage/laypage.js"></script>
        <script type="text/javascript" src="_JS_/getMyDate.js"></script>
        <!-- <script src="js/footable.all.min.js"></script> -->
         <!-- Page-Level Scripts -->
    <script>
        $("#page-title").html("视频管理");
        var userinfo=$.cookie('username');
        if(userinfo!=null){
            var user_login= $.base64.decode(userinfo).split(",");
            var uid=user_login[1];
        }else{
            parent.window.location.href="<?php echo url('admin/login/index'); ?>";
        }
        $(function(){
            management_list(1);
        });
        function management_list(page){
            var search=$('.form-control').val();
            var sort=$('#sort').val();
            $.ajax({
                type: "get",
                url: "<?php echo url('api/video/management'); ?>",
                dataType: 'jsonp',
                jsonp:'callback',
                data: {'page':page,'search':search,'type':sort},
                beforeSend: function () {
                    var index = layer.load(1, {
                        shade: [0.1,'#333333'] //0.1透明度的白色背景
                    });
                },
                success: function (msg) {
                    layer.closeAll();
                    if(msg.code == 200){
                        var pages=Math.ceil(msg.data.count/10);
                        $(".table tbody").html("");
                        if(msg.data.data.length>0){
                            for(var i=0;i<msg.data.data.length;i++){
                                var time = msg.data.data[i].time;
                                var ltime=getMyDate(time*1000);
                                var html='<tr id="'+msg.data.data[i].id+'">';
                                html+='<td><input type="checkbox" name="allcheck"></td>';
                                html+='<td>'+msg.data.data[i].id+'</td><td>'+msg.data.data[i].username+'</td>';
                                html+='<td>'+msg.data.data[i].title+'</td>';
                                html+='<td>'+msg.data.data[i].name+'</td>';
                                html+='<td>'+msg.data.data[i].views+'</td>';
                                html+='<td>'+msg.data.data[i].episode+'</td>';
                                html+='<td>'+msg.data.data[i].likes+'</td>';
                                html+='<td>'+msg.data.data[i].collect+'</td>';
                                html+='<td>'+ltime+'</td>';
                                html+='<td><a href="#" onclick="video_check(this,'+msg.data.data[i].id+')" >查看</a></td>';
                                if(msg.data.data[i].status==1){
                                    html+='<td class="td-status enable" status="1">已发布</td>';
                                    html+='<td class="buttons td-manage"><a class="btn table-btn " onClick="video_down(this)" href="javascript:;" title="下架"><i class="fa fa-cloud-download"></i></a>';
                                }else if(msg.data.data[i].status==2){
                                    html+='<td class="td-status disable" status="2">未发布</td>';
                                    html+='<td class="buttons td-manage"><a class="btn table-btn" onClick="video_up(this)" href="#"><i class="fa fa-cloud-upload enable" title="发布"></i></a>';
                                }
                                html+='<a class="btn table-btn" onclick="video_edit(this,'+msg.data.data[i].id+')" href="#" title="编辑"><i class="fa fa-pencil"></i></a><a class="btn table-btn" onclick="video_del(this)" href="#" title="删除"><i class="fa fa-trash-o"></i></a></td></tr>';
                                $(".table tbody").append(html);
                                $(".table").attr("pages",page);
                                //分页
                                laypage({
                                    cont: 'page',
                                    pages: pages,
                                    curr:page,
                                    jump: function(obj,first){
                                        if(!first){ //点击跳页触发函数自身，并传递当前页：obj.curr
                                            management_list(obj.curr);
                                        }
                                    }
                                })
                            }
                        }

                    }
                    if (msg.code == 1000) {
                        alert("加载信息失败！");
                    }
                }
            });
        }
        //回车键绑定搜索
        $(".search-form").keydown(function(event){
            if(event.keyCode==13){
                search_btn();
            }
        });
        $("#sort").change(function(){
            search_btn();
        });

        //搜索
        function search_btn(){
            management_list(1);
        }

     /*批量删除*/
     function datadel(){
         var arrs=new Array();
         $(".table input[name='allcheck']:checked").each(function(){
             arrs.push($(this).parents('tr').attr('id'));
         });
         if(arrs.length==0 ){
             layer.msg('请选择删除项!',{icon:1,time:1000});
             return false;
         }
         var uids=arrs.join(",");
         layer.confirm('确认要删除多个视频集吗？',function(index){
             var pages_num=$(".table").attr("pages");
             $.ajax({
                 type: "get",
                 url: "<?php echo url('Api/video/management_del'); ?>",
                 dataType: 'jsonp',
                 jsonp:'callback',
                 data: {'id':uids,'status':'3'},
                 success: function (msg) {
                     if(msg.code == 200){
                         $(".table input[name='allcheck']:checked").parents('tr').remove();
                         management_list(pages_num);
                         layer.msg('已删除!',{icon:1,time:1000});
                     }
                     if(msg.code==1000){
                         layer.msg('删除失败!',{icon:5,time:1000});
                     }
                 }
             });
         });
     }
    /*添加*/
    function video_list_add(obj){
        layer.open({
            type: 2,
            title: '添加视频集',
             hadeClose: true,
            shade: 0.8,
            area: ['800px', '600px'],
            content: 'video_list_add.html'
        }); 
    }
    function video_edit(obj,id){
        layer.open({
            type: 2,
            title: '修改视频集',
            hadeClose: true,
            shade: 0.8,
            area: ['800px', '600px'],
            content: 'video_list_edit.html#'+id
        });
    }
    function video_check(obj,id){
        window.location.href= 'video_information.html'+'?id='+id;
    }
    /*删除*/
    function video_del(obj,id){
        layer.confirm('确认要删除吗？',function(index){
            var id=$(obj).parents("tr").attr("id");
            pages_num=$(".table").attr("pages");
            $.ajax({
                type: "get",
                url: "<?php echo url('api/video/management_del'); ?>",
                dataType: 'jsonp',
                jsonp:'callback',
                data: {'id':id,'status':'3'},
                success: function (msg) {
                    if(msg.code == 200){
                        $(obj).parents("tr").remove();
                        management_list(pages_num);
                        layer.msg('已删除!',{icon:1,time:1000});
                    }
                    if(msg.code==1000){
                        layer.msg('删除失败!',{icon:5,time:1000});
                    }
                }
            });
        });
    }

    /*发布*/
    function video_up(obj,id){
        layer.confirm('确认要发布吗？',function(index){
            var id=$(obj).parents("tr").attr("id");
            pages_num=$(".table").attr("pages");
            $.ajax({
                type: "get",
                url: "<?php echo url('api/video/management_del'); ?>",
                dataType: 'jsonp',
                jsonp:'callback',
                data: {'id':id,'status':'1'},
                success: function (msg) {
                    if(msg.code == 200){
                        $(obj).parents("tr").find(".td-manage").prepend('<a class="btn table-btn " onClick="news_down(this)" href="javascript:;" title="下架"><i class="fa fa-cloud-download"></i></a>');
                        $(obj).parents("tr").find(".td-status").html('已发布').attr("status",1);;
                        $(obj).parents("tr").find(".td-status").addClass("enable").removeClass("disable");
                        $(obj).parents("tr").remove();
                        management_list(pages_num);
                        layer.msg('已发布!',{icon:1,time:1000});
                    }
                    if(msg.code==1000){
                        layer.msg('发布失败!',{icon:5,time:1000});
                    }
                }
            });
        });
    }

    /*下架*/
    function video_down(obj,id){
        layer.confirm('确认要下架吗？',function(index){
            var id=$(obj).parents("tr").attr("id");
            pages_num=$(".table").attr("pages");
            $.ajax({
                type: "get",
                url: "<?php echo url('api/video/management_del'); ?>",
                dataType: 'jsonp',
                jsonp:'callback',
                data: {'id':id,'status':'2'},
                success: function (msg) {
                    if(msg.code == 200){
                        $(obj).parents("tr").find(".td-manage").prepend('<a class="btn table-btn" onClick="news_up(this)" href="#"><i class="fa fa-cloud-upload enable" title="发布"></i></a>');
                        $(obj).parents("tr").find(".td-status").html('已下架').attr("status",2);
                        $(obj).parents("tr").find(".td-status").addClass("disable").removeClass("enable");
                        $(obj).parents("tr").remove();
                        management_list(pages_num);
                        layer.msg('已下架!',{icon:1,time:1000});
                    }
                    if(msg.code==1000){
                        layer.msg('下架失败!',{icon:5,time:1000});
                    }
                }
            });
        });
    }
	
	//导出excel
    function down_excel(){
         window.open("/index.php/api/form/get_excel?type=video");
    };

    </script>
    </body>
</html>